'use strict';

angular.module('homepageApp')
  .factory('Backendservice', function Backendservice($http) {
        var getImagesForPage = function () {
            return $http({method: 'GET', url: 'dynamodbApi/getImagesForPage.php'});
        };

        var getPostsForPage = function () {
            return $http({method: 'GET', url: 'dynamodbApi/getPostsForPage.php'});
        };

        var postContactMessage = function ($data) {
            return $http.post('dynamodbApi/index.php/messages', $data);
        };

        return {
            getImagesForPage:  getImagesForPage,
            getPostsForPage: getPostsForPage,
            postContactMessage: postContactMessage
        }

  });
